Skip to content

Conversation

zyguan
Copy link
Contributor

@zyguan zyguan commented Jul 29, 2025

First-time contributors' checklist

What is changed, added or deleted? (Required)

The description of follower-read and learner-read is inaccurate, and related behaviors have been adjusted in the newer version of tidb, so the corresponding documentation has been revised accordingly.

Which TiDB version(s) do your changes apply to? (Required)

Tips for choosing the affected version(s):

By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.

For details, see tips for choosing the affected versions.

  • master (the latest development version)
  • v9.0 (TiDB 9.0 versions)
  • v8.5 (TiDB 8.5 versions)
  • v8.1 (TiDB 8.1 versions)
  • v7.5 (TiDB 7.5 versions)
  • v7.1 (TiDB 7.1 versions)
  • v6.5 (TiDB 6.5 versions)
  • v6.1 (TiDB 6.1 versions)
  • v5.4 (TiDB 5.4 versions)

What is the related PR or file link(s)?

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

@ti-chi-bot ti-chi-bot bot added missing-translation-status This PR does not have translation status info. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 29, 2025
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @zyguan, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request updates the documentation for TiDB's tidb_replica_read system variable, specifically clarifying the behavior of follower and learner read modes. The changes reflect recent adjustments in TiDB's replica reading logic and provide important version-specific details for older releases to ensure the documentation is accurate and up-to-date.

Highlights

  • follower read mode behavior: The description for tidb_replica_read set to follower has been updated. It now clarifies that TiDB also considers reading from learner replicas with equal priority, and if no follower or learner replicas are available, it will fall back to reading from the leader replica.
  • learner read mode behavior: The description for tidb_replica_read set to learner has been revised. Previously, it stated that an error would be returned if no learner replica was available; now, it clarifies that TiDB will attempt to read from available leader or follower replicas in such cases.
  • Version-specific notes: A new note has been added to specify the behavior for TiDB versions up to and including v7.5, detailing that follower and learner read modes would return an error if no appropriate replicas were available, contrasting with the newer fallback behavior.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the documentation for follower and learner reads to reflect new behaviors in recent TiDB versions. The changes clarify that when tidb_replica_read is set to follower or learner, TiDB will now fall back to other replica types if the preferred type is unavailable, instead of returning an error. My review includes suggestions to improve clarity and conciseness, and to align the text with the documentation style guide. The style guide elements referenced in this review include clarity, simplicity, readability, present tense, and second person.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@ti-chi-bot ti-chi-bot bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Sep 11, 2025
@hfxsd hfxsd added translation/from-docs-cn This PR is translated from a PR in pingcap/docs-cn. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. labels Sep 15, 2025
@ti-chi-bot ti-chi-bot bot removed the missing-translation-status This PR does not have translation status info. label Sep 15, 2025
@hfxsd hfxsd self-assigned this Sep 15, 2025
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Sep 15, 2025
@hfxsd hfxsd requested review from cfzjywxk and you06 September 15, 2025 23:42
@hfxsd hfxsd requested a review from qiancai September 19, 2025 08:13
Copy link
Collaborator

@qiancai qiancai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest LGTM

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Sep 19, 2025
Copy link

ti-chi-bot bot commented Sep 19, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-09-15 23:40:20.608240223 +0000 UTC m=+923087.168121720: ☑️ agreed by hfxsd.
  • 2025-09-19 08:42:14.54710096 +0000 UTC m=+544.617594659: ☑️ agreed by qiancai.

@hfxsd
Copy link
Collaborator

hfxsd commented Sep 19, 2025

/approve

Copy link

ti-chi-bot bot commented Sep 19, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hfxsd

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added the approved label Sep 19, 2025
@ti-chi-bot ti-chi-bot bot merged commit accd05b into pingcap:master Sep 19, 2025
9 checks passed
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #21812.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.1: #21813.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.5: #21814.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. translation/from-docs-cn This PR is translated from a PR in pingcap/docs-cn.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants